package com.hulk.dryad.persistence.mapper;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.hulk.dryad.common.constant.CommonConstants;
import com.hulk.dryad.persistence.entity.SysMenuModel;
import com.hulk.dryad.persistence.injector.datascope.mapper.DataScopeMapper;

import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * <p>
 * 菜单权限表 Mapper 接口
 * </p>
 *
 * @author kim
 * @since 2017-10-29
 */
@DS("#" + CommonConstants.TENANT_ID)
@Mapper
public interface SysMenuMapper extends DataScopeMapper<SysMenuModel> {

	/**
	 * 通过角色编号查询菜单
	 * @param roleId 角色ID
	 * @return
	 */
	List<SysMenuModel> listMenusByRoleId(Integer roleId);

	/**
	 * 查询全部菜单
	 * @return
	 */
	List<SysMenuModel> listMenus();

	/**
	 * 通过角色ID查询权限
	 * @param roleIds Ids
	 * @return
	 */
	List<String> listPermissionsByRoleIds(String roleIds);

}
